Implementation Strategies for First-Class Continuations

نویسندگان

  • William D. Clinger
  • Anne Hartheimer
  • Eric Ost
چکیده

Scheme and Smalltalk continuations may have unlimited extent. This means that a purely stack-based implementation of continuations, as suffices for most languages, is inadequate. We review several implementation strategies for continuations and compare their performance using instruction counts for the normal case and continuation-intensive synthetic benchmarks for other scenarios, including coroutines and multitasking. All of the strategies constrain a compiler in some way, resulting in indirect costs that are hard to measure directly. We use related measurements on a set of benchmarks to calculate upper bounds for these indirect costs.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Formalizing Implementation Strategies for First-Class Continuations

We present the first formalization of implementation strategies for first-class continuations. The formalization hinges on abstract machines for continuation-passing style (CPS) programs with a special treatment for the current continuation, accounting for the essence of first-class continuations. These abstract machines are proven equivalent to a standard, substitution-based abstract machine. ...

متن کامل

Threads Yield Continuations

Just as a traditional continuation represents the rest of a computation from a given point in the computation, a subcontinuation represents the rest of a subcomputation from a given point in the subcomputation. Subcontinuations are more expressive than traditional continuations and have been shown to be useful for controlling tree-structured concurrency, yet they have previously been implemente...

متن کامل

Delimited Continuations in Prolog: Semantics, Use, and Implementation in the WAM

An implementation of a delimited continuations, known in the functional programming world, is shown in the context of the WAM, and more particular in hProlog. Three new predicates become available to the user: reset/3 and shift/1 for delimiting and capturing the continuation, and call continuation/1 for calling it. The underlying low-level built-ins and modifications to the system are described...

متن کامل

Software Transactions Meet First-Class Continuations

Software transactions are a promising technology that make writing correct and efficient shared-memory multithreaded programs easier, but adding transactions to programming languages requires defining and implementing how they interact with existing language features. In this work, we consider how transactions interact with first-class continuations. We demonstrate that different idiomatic uses...

متن کامل

The Semantics of pcall and fork in the Presence of First-Class Continuations and Side-Effects

We present the semantics of the annotations pcall and fork for parallel evaluation of Scheme Annotated programs are proved to be behaviourly indistinguishable from their non annotated counterparts even in the presence of rst class continuations and side e ects The semantics takes the form of an abstract machine which can be regarded as a guideline for an implementation

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:
  • Higher-Order and Symbolic Computation

دوره 12  شماره 

صفحات  -

تاریخ انتشار 1999